package com.hyt.it.ogt.kq.service.bm.feign.cj;

import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.common.utils.exception.RemoteRequestExcepton;
import com.hyt.it.ogt.kq.service.bm.feign.cj.model.ApiExamPublishInfo;
import com.hyt.it.ogt.kq.service.bm.model.dto.ApiExamPublishInfoDTO;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class CjClientHystrix implements FallbackFactory<CjClient> {

    @Override
    public CjClient create(Throwable cause) {
        log.error("# CjClient Hystrix message ", cause);

        return new CjClient() {
            @Override
            public ApiResponse<List<ApiExamPublishInfoDTO>> getExamPublishInfoVos(List<ApiExamPublishInfo> apiExamPublishInfos) {
                throw new RemoteRequestExcepton("获取考生发布考试信息失败");
            }
        };
    }
}
